package countGoodRectangles;

import java.util.HashMap;
import java.util.Map;

public class Solution {
    public int countGoodRectangles(int[][] rectangles) {
        int max = 0;
        for (int i = 0; i < rectangles.length; i++) {
            int t = Math.min(rectangles[i][0],rectangles[i][1]);
            max = Math.max(t,max);
        }
        int ans = 0;
        for (int i = 0; i < rectangles.length; i++) {
            if(Math.min(rectangles[i][0],rectangles[i][1])==max){
                ans++;
            }
        }
        return ans;
    }
}
